/**
 * @filename:LecturerTitleServiceImpl Course
 * @project constract  V1.0
 * Copyright(c) 2018  Co. Ltd.
 * All right reserved.
 */
package com.znufe.exam.service.impl;

import java.util.List;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.znufe.exam.repository.LecturerTitleMapper;
import com.znufe.exam.viewmodel.admin.lecturertitle.LecturerTitlePageRequestVm;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.znufe.exam.domain.LecturerTitle;
import com.znufe.exam.service.LecturerTitleService;

/**
 *
 * @Description:  讲师职称分类表——SERVICEIMPL
 * @Author:
 * @CreateDate:   Course
 * @Version:      V1.0
 *
 */
@Service
public class LecturerTitleServiceImpl implements LecturerTitleService {

	@Autowired
	public LecturerTitleMapper lecturerTitleMapper;

	//查询对象
	@Override
	public LecturerTitle selectByPrimaryKey(Integer id) {
		return lecturerTitleMapper.selectByPrimaryKey(id);
	}

	//删除对象
	@Override
	public int deleteByPrimaryKey(Integer id) {
		return lecturerTitleMapper.deleteByPrimaryKey(id);
	}

	//添加对象
	@Override
	public int insertSelective(LecturerTitle lecturerTitle) {
		return lecturerTitleMapper.insertSelective(lecturerTitle);
	}

	//修改对象
	@Override
	public int updateByPrimaryKeySelective(LecturerTitle lecturerTitle) {
		return lecturerTitleMapper.updateByPrimaryKeySelective(lecturerTitle);
	}

	//查询集合
	@Override
	public List<LecturerTitle> queryLecturerTitleList(LecturerTitle lecturerTitle) {
		return lecturerTitleMapper.queryLecturerTitleList(lecturerTitle);
	}

	@Override
    public PageInfo<LecturerTitle> titlePage(LecturerTitlePageRequestVm requestVm){
	    return PageHelper.startPage(requestVm.getPageNum(),requestVm.getPageSize(),"gmt_create desc").doSelectPageInfo(()->
                lecturerTitleMapper.titlePage(requestVm));
    }

    @Override
    public LecturerTitle getTitleByName(String titleName) {
        return lecturerTitleMapper.getTitleByName(titleName);
    }

    @Override
    public List<LecturerTitle> getAllTitle() {
        return lecturerTitleMapper.getAllTitle();
    }
}
